SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwlMovimientosBYP
AS
SELECT dbo.tb_MovimientosBYP.idMovimiento AS Id, dbo.vwrLiquidacionBYP.Descripcion AS Liquidacion, 
               dbo.vwrTiposDeMovimiento.Descripcion AS TipoDeMovimiento, dbo.tb_BecasYPrestamos.idAlumno AS Alumno
FROM  dbo.tb_MovimientosBYP INNER JOIN
               dbo.vwrLiquidacionBYP ON dbo.tb_MovimientosBYP.LiquidacionByP = dbo.vwrLiquidacionBYP.ID INNER JOIN
               dbo.tb_BecasYPrestamos ON dbo.tb_MovimientosBYP.IdBecaYPrestamo = dbo.tb_BecasYPrestamos.idBeca LEFT OUTER JOIN
               dbo.vwrTiposDeMovimiento ON dbo.tb_MovimientosBYP.IdTipoDeMovimiento = dbo.vwrTiposDeMovimiento.Id
GO
GRANT SELECT ON  [dbo].[vwlMovimientosBYP] TO [SoloVer]
GO
